home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / lib / udev / check_driver < prev    next >
Text File  |  2009-10-14  |  499b  |  25 lines

  1. #!/bin/sh
  2. #
  3.  
  4. #logger check_driver called with: $1 - $2 - $3 -
  5.  
  6. wanted=$1
  7. devpath=$2
  8. bustype=$3
  9.  
  10. device=$(readlink /sys/$devpath/device)
  11. device=${device##*/}
  12. driver=$(readlink /sys/$devpath/device/driver)
  13. driver=${driver##*/}
  14.  
  15. logger device $device is bound to the $driver driver
  16.  
  17. if [ "$driver" != "$wanted" ]; then
  18.     logger must rebind
  19.     echo -n "$device" > /sys/$devpath/device/driver/unbind
  20.     echo -n "$device" > /sys/bus/$bustype/drivers/$wanted/bind
  21. else
  22.     logger no need to rebind
  23. fi
  24.  
  25.